//
//  UFOLQCHotView.m
//  unrivalledForUniverse
//
//  Created by dllo on 1/16/16.
//  Copyright © 2016 dllo. All rights reserved.
//

#import "UFOLQCHotView.h"

@implementation UFOLQCHotView

- (void)dealloc
{
    [_hotTitleLabel release];
    [_hotNameLabel release];
    [_hotImageView release];
    [_hotNumLabel release];
    [_roomID release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}


- (void)createSubviews
{
    
    self.hotImageView = [UIImageView new];
    
    [self addSubview:self.hotImageView];
    
    
    self.hotTitleLabel = [UILabel new];
    self.hotTitleLabel.backgroundColor = [UIColor colorWithWhite:0.200 alpha:1.000];
    self.hotTitleLabel.textColor = [UIColor whiteColor];
    self.hotTitleLabel.font = [UIFont systemFontOfSize:13];
    [self addSubview:self.hotTitleLabel];
    
    self.hotNameLabel = [UILabel new];
    self.hotNameLabel.textColor = [UIColor whiteColor];
    self.hotNameLabel.font = [UIFont systemFontOfSize:15];
    self.hotNameLabel.backgroundColor = [UIColor colorWithRed:0.024 green:0.029 blue:0.024 alpha:0.450];
    [self addSubview:self.hotNameLabel];
    
    self.hotNumLabel = [UILabel new];
    self.hotNumLabel.backgroundColor = [UIColor colorWithRed:0.024 green:0.029 blue:0.024 alpha:0.450];
    self.hotNumLabel.font = [UIFont systemFontOfSize:13];
    self.hotNumLabel.textAlignment = NSTextAlignmentCenter;
    self.hotNumLabel.textColor = [UIColor whiteColor];
    [self addSubview:self.hotNumLabel];
    
    [self.hotImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(self).offset(0);
        make.bottom.equalTo(self.hotTitleLabel.mas_top).offset(0);
    }];
    
    
    [self.hotTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.right.equalTo(self).offset(0);
        make.height.mas_equalTo(@25);
    }];
    
    
    [self.hotNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(self.hotImageView).offset(0);
        make.right.equalTo(self.hotNumLabel.mas_left).offset(0);
        make.height.mas_equalTo(@25);
    }];
    
    
    [self.hotNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.right.equalTo(self.hotImageView).offset(0);
        make.right.equalTo(self.hotImageView).offset(0);
        make.height.mas_equalTo(@25);
        make.width.mas_equalTo(@70);
    }];

 
}


@end
